#[macro_use]
extern crate bencher;
use bencher::Bencher;
// func
fn test_slice_str(intro: &str, head: usize, tail: usize) -> &str {
    if head > 0 || tail < intro.len() {
        return &intro[head..tail];
    }
    return &intro[..];
}

fn test_slice_string(intro: &str, head: usize, tail: usize) -> String {
    if head > 0 || tail < intro.len() {
        return String::from(&intro[head..tail]);
    }
    return String::from(&intro[..]);
}

fn test_slice_cstring(intro: &str, head: usize, tail: usize) -> String {
    if head > 0 || tail < intro.len() {
        let mut result = String::new();
        for i in [head..tail] {
            result.push_str(&intro[i]);
        }
        return result;
    }
    "".to_string()
}

fn fa(intro: u64) -> u64 {
    match intro {
        0 => 0,
        1 => 1,
        e => fa(e - 1) + fa(e - 2),
    }
}

fn ffa(intro: u64) -> u64 {
    match intro {
        x if x < 0 => 0,
        0 => 0,
        1 => 1,
        e => {
            let mut x: (u64, u64) = (0, 1);
            for _ in 2..=e {
                let i1 = x.0;
                x.0 = x.1;
                x.1 = i1 + x.0;
            }
            x.1
        }
    }
}

const TESTS_STRING: &str = "asdasdasdasdasdasd";

fn a(bench: &mut Bencher) {
    bench.iter(|| {})
}
fn b(bench: &mut Bencher) {
    bench.iter(|| ffa(25))
}

benchmark_group!(benches, a, b);
benchmark_main!(benches);
